<h1>Listing brands</h1>

<table>
  <tr>
  <% for column in Brand.content_columns %>
    <th><%= column.human_name %></th>
  <% end %>
  </tr>
  
<% for brand in @brands %>
  <tr>
  <% for column in Brand.content_columns %>
  	<% if column.name == "on_logo" %>
  	<td><%= image_tag("/binary/brand_logo_on/#{brand.id}") %></td>
  	<% elsif column.name == "off_logo" %>
  	<td><%= image_tag("/binary/brand_logo_off/#{brand.id}") %></td>
  	<% else %>
    <td><%=h brand.send(column.name) %></td>
    <% end %>
  <% end %>
    <td><%= link_to 'Show', :action => 'show', :id => brand %></td>
    <td><%= link_to 'Edit', :action => 'edit', :id => brand %></td>
    <td><%= link_to 'Destroy', { :action => 'destroy', :id => brand }, :confirm => 'Are you sure?', :method => :post %></td>
  </tr>
<% end %>
</table>

<%= link_to 'Previous page', { :page => @brand_pages.current.previous } if @brand_pages.current.previous %>
<%= link_to 'Next page', { :page => @brand_pages.current.next } if @brand_pages.current.next %> 

<br />

<%= link_to 'New brand', :action => 'new' %>
